﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace SmsUI
{
    public static class CheckPortUsed
    {
        public static void CheckPort()
        {

            int id = Process.GetCurrentProcess().Id;
            Process[] plist = Process.GetProcesses();
            foreach (Process pi in plist)
            {
                if (pi.ProcessName == "SmsUI" && pi.Id != id)
                {
                    pi.Kill();
                }
            }

        }
    }
}
